package cc.bluemc.modules.weixin.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.gson.bean.AuthorizationInfo;

import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;
@Table(name="t_wx_public_account")
public class WxPublicAccountEntity implements Serializable{
    /**
     * 授权方appid
     **/
    private String appid;

    private Integer adminUserId;

    /**
     * 刷新令牌
     **/
    private String authorizerRefreshToken;

    /**
     * 授权时间
     **/
    private Date authorizerTime;

    /**
     * 公众号授权给开发者的权限集列表
     **/
    private String funcInfo;

    /**
     * 授权方昵称
     **/
    @JSONField(name = "nick_name")
    private String nickName;

    /**
     * 授权方头像
     **/
    @JSONField(name = "head_img")
    private String headImg;

    /**
     * 授权方公众号类型，0代表订阅号，1代表由历史老帐号升级后的订阅号，2代表服务号
     **/
//    @JSONField(name = "service_type_info")
    private Integer serviceTypeInfo;

    /**
     * 授权方认证类型，-1代表未认证，0代表微信认证，1代表新浪微博认证，2代表腾讯微博认证，3代表已资质认证通过但还未通过名称认证，4代表已资质认证通过、还未通过名称认证，但通过了新浪微博认证，5代表已资质认证通过、还未通过名称认证，但通过了腾讯微博认证
     **/
//    @JSONField(name = "verify_type_info")
    private Integer verifyTypeInfo;

    /**
     * 授权方公众号的原始ID
     **/
    @JSONField(name = "user_name")
    private String userName;

    /**
     * 公众号的主体名称
     **/
    @JSONField(name = "principal_name")
    private String principalName;

    /**
     * 授权方公众号所设置的微信号
     **/
    @JSONField(name = "alias")
    private String alias;

    /**
     * 二维码图片的URL
     **/
    @JSONField(name = "qrcode_url")
    private String qrcodeUrl;

    /**
     * 功能的开通状况（0代表未开通，1代表已开通）
     **/
//    @JSONField(name = "business_info")
    private String businessInfo;

    public WxPublicAccountEntity() {
    }
    public WxPublicAccountEntity(AuthorizationInfo info) {
        this.appid=info.getAuthorizer_appid();
        this.authorizerRefreshToken=info.getAuthorizer_refresh_token();
    }


    public WxPublicAccountEntity(String appid, Integer adminUserId, String authorizerRefreshToken, Date authorizerTime, String funcInfo, String nickName, String headImg, Integer serviceTypeInfo, Integer verifyTypeInfo, String userName, String principalName, String alias, String qrcodeUrl, String businessInfo) {
        this.appid = appid;
        this.adminUserId = adminUserId;
        this.authorizerRefreshToken = authorizerRefreshToken;
        this.authorizerTime = authorizerTime;
        this.funcInfo = funcInfo;
        this.nickName = nickName;
        this.headImg = headImg;
        this.serviceTypeInfo = serviceTypeInfo;
        this.verifyTypeInfo = verifyTypeInfo;
        this.userName = userName;
        this.principalName = principalName;
        this.alias = alias;
        this.qrcodeUrl = qrcodeUrl;
        this.businessInfo = businessInfo;
    }

    public void setAppid(String appid) {
        this.appid = appid;
    }
	 @Id
    public String getAppid() {
        return appid;
    }

    public void setAdminUserId(Integer adminUserId) {
        this.adminUserId = adminUserId;
    }
    public Integer getAdminUserId() {
        return adminUserId;
    }

    public void setAuthorizerRefreshToken(String authorizerRefreshToken) {
        this.authorizerRefreshToken = authorizerRefreshToken;
    }
    public String getAuthorizerRefreshToken() {
        return authorizerRefreshToken;
    }

    public void setAuthorizerTime(Date authorizerTime) {
        this.authorizerTime = authorizerTime;
    }
    public Date getAuthorizerTime() {
        return authorizerTime;
    }

    public void setFuncInfo(String funcInfo) {
        this.funcInfo = funcInfo;
    }
    public String getFuncInfo() {
        return funcInfo;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }
    public String getNickName() {
        return nickName;
    }

    public void setHeadImg(String headImg) {
        this.headImg = headImg;
    }
    public String getHeadImg() {
        return headImg;
    }

    public void setServiceTypeInfo(Integer serviceTypeInfo) {
        this.serviceTypeInfo = serviceTypeInfo;
    }
    public Integer getServiceTypeInfo() {
        return serviceTypeInfo;
    }

    public void setVerifyTypeInfo(Integer verifyTypeInfo) {
        this.verifyTypeInfo = verifyTypeInfo;
    }
    public Integer getVerifyTypeInfo() {
        return verifyTypeInfo;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }
    public String getUserName() {
        return userName;
    }

    public void setPrincipalName(String principalName) {
        this.principalName = principalName;
    }
    public String getPrincipalName() {
        return principalName;
    }

    public void setAlias(String alias) {
        this.alias = alias;
    }
    public String getAlias() {
        return alias;
    }

    public void setQrcodeUrl(String qrcodeUrl) {
        this.qrcodeUrl = qrcodeUrl;
    }
    public String getQrcodeUrl() {
        return qrcodeUrl;
    }


    public void setBusinessInfo(String businessInfo) {
        this.businessInfo = businessInfo;
    }
    public String getBusinessInfo() {
        return businessInfo;
    }

    @Override
    public String toString() {
        return "WxPublicAccountEntity{" +
                "appid='" + appid + '\'' +
                ", adminUserId=" + adminUserId +
                ", authorizerRefreshToken='" + authorizerRefreshToken + '\'' +
                ", authorizerTime=" + authorizerTime +
                ", funcInfo='" + funcInfo + '\'' +
                ", nickName='" + nickName + '\'' +
                ", headImg='" + headImg + '\'' +
                ", serviceTypeInfo=" + serviceTypeInfo +
                ", verifyTypeInfo=" + verifyTypeInfo +
                ", userName='" + userName + '\'' +
                ", principalName='" + principalName + '\'' +
                ", alias='" + alias + '\'' +
                ", qrcodeUrl='" + qrcodeUrl + '\'' +
                ", businessInfo='" + businessInfo + '\'' +
                '}';
    }

}
